package com.nanjia.boot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * 应用启动类
 *
 * @author Ray.Hao
 * @since 0.0.1
 */
@SpringBootApplication
@ConfigurationPropertiesScan // 开启配置属性绑定
@EnableAsync
public class NanjiaFrontBootApplication extends SpringBootServletInitializer {
    static {
        // 在类加载时注册BouncyCastle提供者
        java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());

    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(NanjiaFrontBootApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(NanjiaFrontBootApplication.class, args);
    }

}
